<?php
   include("./dbconn.php");

  $page = $_GET["page"];
  $pageSize = 10;    
  $start = ($page - 1) * $pageSize;

  $sql = "select * from midata limit $start,10";

  $result = $conn->query($sql);
  if($result->num_rows > 0){
     for($i=0; $i<$result->num_rows; $i++){
        $list[] = mysqli_fetch_assoc($result);
     }
     $data['code'] = 0;
     $data['list'] = $list;
  }else{
     $data['code'] = 1;
  }
  echo json_encode($data); 
?>